Given a binary tree, find its height.
Example 1:
Input:
1
/ \
2 3
Output: 2
Example 2:
Input:
2
\
1
/
3
Output: 3
Code
int height(Node* node)
{
if(node==NULL)
return 0;
return 1+max(height(node->left),height(node->right));
}